package com.ibeeking.found.content.api.feign;

import com.ibeeking.found.content.api.common.dto.PageBaseInfoDTO;
import com.ibeeking.found.content.api.common.query.PageBaseInfoQuery;
import com.ibeeking.found.content.api.feign.fallback.CmsFeignBFallbackFactory;
import com.ibeeking.nematos.utils.result.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;


/**
 * @Author ibeeking
 */
@FeignClient(name = "base-cms-b-server", path = "/b", contextId = "contentCmsBClient", fallbackFactory = CmsFeignBFallbackFactory.class, decode404 = true)
public interface CmsFeignBClient {

    /**
     * 查询页面信息
     *
     * @param queries
     * @return
     */
    @PostMapping(value = "/cms/feign/v1/pageBaseInfoList")
    ResponseResult<List<PageBaseInfoDTO>> pageBaseInfoList(@RequestBody List<PageBaseInfoQuery> queries);

    /**
     * 根据页面类型查询页面信息
     *
     * @param pageType
     * @return
     */
    @GetMapping(value = "/cms/feign/v1/pageBaseInfoListByPageType/{pageType}")
    ResponseResult<List<PageBaseInfoDTO>> pageBaseInfoListByPageType(@PathVariable("pageType") Integer pageType);
}
